package pbx.model;

import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;




import callcenter.model.Agent;
import callcenter.model.SessionType;



@Entity
@Table(name = "queue", schema="public")
public class Queue {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;	
	
	@Column(unique = true)
	private String name;
	private String label;
	private String musicOnHold;
	private String strategy;
	
	@ManyToOne
	private Pbx pbx;
	
	@OneToMany(cascade=CascadeType.ALL, mappedBy="queue")
	private List<QueueLogResult> queuelogresults;	
	
	@OneToMany(cascade=CascadeType.ALL, mappedBy="queue")
	private List<QueueMember> queuemembers;	

	@OneToMany(cascade=CascadeType.ALL, mappedBy="queue")
	private List<QueueLogSummary> queueLogSummary;
	
	@ManyToMany(mappedBy="queues")
	private Set<SessionType> sessionTypes;
	
	@ManyToMany(mappedBy="queues")
	private Set<Agent> agents;
	
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	public String getMusicOnHold() {
		return musicOnHold;
	}
	public void setMusicOnHold(String musicOnHold) {
		this.musicOnHold = musicOnHold;
	}
	public String getStrategy() {
		return strategy;
	}
	public void setStrategy(String strategy) {
		this.strategy = strategy;
	}
	public Pbx getPbx() {
		return pbx;
	}
	public void setPbx(Pbx pbx) {
		this.pbx = pbx;
	}
	public Set<SessionType> getSessionTypes() {
		return sessionTypes;
	}
	public void setSessionTypes(Set<SessionType> sessionTypes) {
		this.sessionTypes = sessionTypes;
	}
	public Set<Agent> getAgents() {
		return agents;
	}
	public void setAgents(Set<Agent> agents) {
		this.agents = agents;
	}
	

}
